/*
 * Copyright (c) 2010 by Aleksey Zhukov
 * Licensed under the Apache License, Version 2.0 (the "License")
 */

package ru.listfunc4j.test;

/**
 * User: J0k3r
 * Date: 28.11.2010
 * Time: 15:22:44
 */
public class Timer {
    private static long start = -1;
    private static long previous = -1;

    public static void start() {
        start = System.currentTimeMillis();
        previous = start;
    }

    public static void tick(String tikingString) {
        if (start == -1) {
            System.out.println(tikingString + " : Not started");
            return;
        }
        long current = System.currentTimeMillis();
        System.out.println("Singe start = " + (current - start) + ";\tSince last tick = " + (current - previous) + "\t\t" + tikingString);
        previous = current;
    }
}
